<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>授权商户</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="-1049680873">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "-1049680873";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("host.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建授权商户"
  			,"inport":"导入授权商户"
  			,"update":"修改授权商户"
  			,"detail":"授权商户详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#hostForm").form({
		"":function(){}
		,"srvHost.shId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvHost.shName":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "商户名称不能为空";
			}
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "商户名称最大长度为32个字符";
		}
		,"srvHost.shFlag":function(el){
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "标识最大长度为32个字符";
		}
		,"srvHost.shMaster":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "负责人不能为空";
			}
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "负责人最大长度为32个字符";
		}
		,"srvHost.shCompany":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "公司名称不能为空";
			}
			if(el.value.length>128 && el.value.indexOf("[*]")==-1)
				return "公司名称最大长度为128个字符";
		}
		,"srvHost.shDesc":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "描述不能为空";
			}
			if(el.value.length>256 && el.value.indexOf("[*]")==-1)
				return "描述最大长度为256个字符";
		}
		,"srvHost.shStatus":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "请选择状态";
			}
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="SrvHost" id="hostForm" name="hostForm" target="jsoniframe" action="host.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt">
				温馨提示：请仔细填写授权商户相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("shId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"shId"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"shId"))))}}
	{{lz.set("shId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$shId}}
	<dl lz:if="{{shId_editable||shId_readonly}}" class="shId hidden " major  ref="shId">
		<dt>编　　号:</dt>
		<dd lz:if="{{shId_editable}}" input="hidden">
			<lz:block lz:if="{{srvHost$shId}}">
				{{srvHost$shId}}
			</lz:block>
			<lz:block lz:if="{{!srvHost$shId}}">
			<input type="hidden" value="{{lz.htm(srvHost.shId)}}" name="srvHost.shId" id="shId" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{shId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="shId">{{srvHost.shId}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvHost.shId$||srvHost.shId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$shId}}
	{{lz.set("shName_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"shName"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"shName"))))}}
	{{lz.set("shName_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$shName}}
	<dl lz:if="{{shName_editable||shName_readonly}}" class="shName  " major  ref="shName">
		<dt>商户名称:</dt>
		<dd lz:if="{{shName_editable}}" input="text">
			<lz:block lz:if="{{srvHost$shName}}">
				{{srvHost$shName}}
			</lz:block>
			<lz:block lz:if="{{!srvHost$shName}}">
		 	<input type="text" class="input narrow"   name="srvHost.shName" id="shName"  value="{{lz.htm(srvHost.shName)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入授权商户的商户名称</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{shName_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="shName">{{srvHost.shName}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvHost.shName$||srvHost.shName)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$shName}}
	{{lz.set("shFlag_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"shFlag"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"shFlag"))))}}
	{{lz.set("shFlag_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$shFlag}}
	<dl lz:if="{{shFlag_editable||shFlag_readonly}}" class="ribs shFlag  " major  ref="shFlag">
		<dt>标　　识:</dt>
		<dd lz:if="{{shFlag_editable}}" input="text">
			<lz:block lz:if="{{srvHost$shFlag}}">
				{{srvHost$shFlag}}
			</lz:block>
			<lz:block lz:if="{{!srvHost$shFlag}}">
		 	<input type="text" class="input narrow"  maxlength="32" name="srvHost.shFlag" id="shFlag"  value="{{lz.htm(srvHost.shFlag)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入授权商户的标识</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{shFlag_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="shFlag">{{srvHost.shFlag}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvHost.shFlag$||srvHost.shFlag)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$shFlag}}
	{{lz.set("shMaster_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"shMaster"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"shMaster"))))}}
	{{lz.set("shMaster_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$shMaster}}
	<dl lz:if="{{shMaster_editable||shMaster_readonly}}" class="shMaster  " major  ref="shMaster">
		<dt>负 责 人:</dt>
		<dd lz:if="{{shMaster_editable}}" input="text">
			<lz:block lz:if="{{srvHost$shMaster}}">
				{{srvHost$shMaster}}
			</lz:block>
			<lz:block lz:if="{{!srvHost$shMaster}}">
		 	<input type="text" class="input narrow"  maxlength="32" name="srvHost.shMaster" id="shMaster"  value="{{lz.htm(srvHost.shMaster)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入授权商户的负责人</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{shMaster_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="shMaster">{{srvHost.shMaster}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvHost.shMaster$||srvHost.shMaster)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$shMaster}}
	{{lz.set("shCompany_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"shCompany"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"shCompany"))))}}
	{{lz.set("shCompany_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$shCompany}}
	<dl lz:if="{{shCompany_editable||shCompany_readonly}}" class="shCompany   mider" major  ref="shCompany">
		<dt>公司名称:</dt>
		<dd lz:if="{{shCompany_editable}}" input="text">
			<lz:block lz:if="{{srvHost$shCompany}}">
				{{srvHost$shCompany}}
			</lz:block>
			<lz:block lz:if="{{!srvHost$shCompany}}">
		 	<input type="text" class="input mide"  maxlength="128" name="srvHost.shCompany" id="shCompany"  value="{{lz.htm(srvHost.shCompany)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入授权商户的公司名称</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{shCompany_readonly}}">
		 	<div class="state-input mide">
		 		<textarea class=""  style="display:none;" id="shCompany">{{srvHost.shCompany}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvHost.shCompany$||srvHost.shCompany)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$shCompany}}
	{{lz.set("shDesc_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"shDesc"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"shDesc"))))}}
	{{lz.set("shDesc_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$shDesc}}
	<dl lz:if="{{shDesc_editable||shDesc_readonly}}" class="shDesc   mider" major  ref="shDesc">
		<dt>描　　述:</dt>
		<dd lz:if="{{shDesc_editable}}" input="text">
			<lz:block lz:if="{{srvHost$shDesc}}">
				{{srvHost$shDesc}}
			</lz:block>
			<lz:block lz:if="{{!srvHost$shDesc}}">
		 	<input type="text" class="input mide"  maxlength="256" name="srvHost.shDesc" id="shDesc"  value="{{lz.htm(srvHost.shDesc)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入授权商户的描述</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{shDesc_readonly}}">
		 	<div class="state-input mide">
		 		<textarea class=""  style="display:none;" id="shDesc">{{srvHost.shDesc}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvHost.shDesc$||srvHost.shDesc)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$shDesc}}
	{{lz.set("shStatus_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"shStatus"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"shStatus"))))}}
	{{lz.set("shStatus_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$shStatus}}
	<dl lz:if="{{shStatus_editable||shStatus_readonly}}" class="shStatus  " major  ref="shStatus">
		<dt>状　　态:</dt>
		<dd lz:if="{{shStatus_editable}}" input="select">
			<lz:block lz:if="{{srvHost$shStatus}}">
				{{srvHost$shStatus}}
			</lz:block>
			<lz:block lz:if="{{!srvHost$shStatus}}">
		 	<select class="narrow" id="shStatus" name="srvHost.shStatus">
		 		<option value="">请选择</option>
				<option value="1" selected='{{srvHost.shStatus=="1"?"selected":""}}'>正常</option>
				<option value="0" selected='{{srvHost.shStatus=="0"?"selected":""}}'>无效</option>
		 	</select>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择授权商户的状态</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{shStatus_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="shStatus">{{srvHost.shStatus}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvHost.shStatus$||srvHost.shStatus)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$shStatus}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{srvHost.shId}}" name="srvHost.shId" id="shId" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canEdit}}" type="button" class="button" onclick='window.location.href="/admin/permissions/host.edit.html?edittype=update&id={{srvHost.id}}"'>
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					修改&nbsp;&nbsp;</button>
				<button lz:if="{{canDel}}" type="button" class="button" onclick="deleteHost('{{srvHost.id}}','{{srvHost.shName}}')">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					删除&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/permissions/host.edit.html",document.title,"/admin//images/icons/20088256423826577805.png");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/permissions/host.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


	/**
	* 删除授权商户
	**/
	function deleteHost(id,flag)
	{
		var dialog=top.$.dialog({
				html:"<span style='white-space:nowrap;'>确定要删除当前数据吗？</span>",
				title:"删除授权商户",
				modal: true,			
				onOk:function(){
					dialog.closeDialog();
					var url = "/admin/permissions/host.delete.do";
					var params = {id:id};
					var protocol = $.getAjax(url,params);
					if(protocol.message){
						top.$.toast(protocol.message);
					}
					if(protocol.success){
						caller.location.href=caller.location.href;		
					}
				}
		 });	
	}
</script>
</html>